cmake_minimum_required(VERSION 3.22)

project(kernel)
add_library(${PROJECT_NAME} INTERFACE)

target_compile_definitions(${PROJECT_NAME} INTERFACE
	CONFIG_HZ=1000
    __KERNEL__
    $<$<CONFIG:Debug>:DEBUG>
)

target_include_directories(${PROJECT_NAME} INTERFACE
    ./include
    ./app/include
)

FILE(GLOB_RECURSE SRC_FILES ./*.c*)

target_sources(${PROJECT_NAME} INTERFACE
    ${SRC_FILES}
)

target_link_directories(${PROJECT_NAME} INTERFACE
)

target_link_libraries(${PROJECT_NAME} INTERFACE
    stdc++
)

# Validate that STM32CubeMX code is compatible with C standard
if(CMAKE_C_STANDARD LESS 11)
    message(ERROR "Generated code requires C11 or higher")
endif()


